#ifndef ATTRIBUTESETTING_H
#define ATTRIBUTESETTING_H

#include <QWidget>
class InquireSql;
class QTableWidgetItem;

enum Attribute{SpecificationSetting, BrandsSetting, ColorSetting, UnitSetting};

namespace Ui {
class AttributeSetting;
}

class AttributeSetting : public QWidget
{
    Q_OBJECT
    
public:
    explicit AttributeSetting(QWidget *parent = 0);
    ~AttributeSetting();
    void displayAttributePage(const int&);
    
signals:
    void signalUpdateComboBoxAttribute(int);

private slots:
    void on_tabWidget_currentChanged(int index);

    void on_pushButtonNew_clicked();

    void on_pushButtonModify_clicked();

    void on_pushButtonDelete_clicked();

    void on_tableWidgetSpecification_currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous);

    void on_tableWidgetBrands_currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous);

    void on_tableWidgetColor_currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous);

    void on_tableWidgetUnit_currentItemChanged(QTableWidgetItem *current, QTableWidgetItem *previous);

protected:
    void keyPressEvent(QKeyEvent *);

private:
    Ui::AttributeSetting *ui;
    InquireSql *m_sql;
    int m_currentPage;

    bool pageChange;
};

#endif // ATTRIBUTESETTING_H
